package com.example.rx.rxtest;

import android.app.Application;

import com.example.rx.rxtest.dagger.ApplicationModel;
import com.example.rx.rxtest.dagger.DaggerAppComponent;

import retrofit2.Converter;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;

/**
 * @author LiuChao
 * @describe
 * @date 2016/12/26
 * @contact email:450127106@qq.com
 */

public class MyApplication extends Application {
    public static Retrofit sRetrofit;
    @Override
    public void onCreate() {
        super.onCreate();
        initRetrofit();
    }

    private void initRetrofit() {
        sRetrofit = new Retrofit.Builder()
                .baseUrl("https://appapi.mala.cn")
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .addConverterFactory(ScalarsConverterFactory.create())
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
}
